package com.supcon.exchangedata.repository.slave4;


import com.supcon.exchangedata.pojo.entity.mysql.operation.gj.SgjjtCardTypeDay;
import com.supcon.exchangedata.pojo.entity.mysql.operation.gj.SgjjtCityIndicator;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *   公交按支付方式客运量
 * @Author: yangbin
 * @Date: 2022/04/20/9:00
 * @Description:
 */
public interface SlaveGjOperationInfo3 extends JpaRepository<SgjjtCardTypeDay, Long> {


    @Transactional
    @Query(nativeQuery = true, value = "SELECT * FROM sgjjt_card_type_day where trade_date = (SELECT MAX(trade_date) from sgjjt_card_type_day)")
    SgjjtCardTypeDay findTopData();

    @Transactional
    @Query(nativeQuery = true, value = "SELECT * FROM sgjjt_card_type_day where trade_date > ?1 and trade_date <= ?2")
    List<SgjjtCardTypeDay> busPassengerByPayData(String startTime, String endTime);
}
